<?PHP

function getdata($data) {
    $str = "";
    foreach ($data as $key => $val) {
        $str .= "$key=$val&";
    }
    return rtrim($str, "&");
}

echo "请求方法: ", $_SERVER["REQUEST_METHOD"], "<br />";
echo "请求文件类型: ", $_SERVER["CONTENT_TYPE"], "<br />";
echo "GET数据: ", getData($_GET), "<br />";
echo "POST数据: ", getData($_POST), "<br />";
echo "File数据: ", getData($_FILES["logo"]), "<br />";
echo "==== 以下为服务器回应的数据 ====</br />";
$data = file_get_contents("php://input");
echo "data len: ", strlen($data);
echo $data;
// sleep(5);
// file_put_contents("/dev/shm/123.jpg", $data);

